package de.clue.corpus.twitter.reader;

import java.util.List;

import com.twitter.Extractor;

public class ReplaceLinkTextWorker implements ITextWorker {

    @Override
    public String process(String text) {
        
        String internalText = text;
        
        //internalText = internalText.replaceAll("(^|\\s)@(\\w+)", "BENUTZERNAME");        
        //internalText = internalText.replaceAll("(^|[^a-zA-Z0-9_])@([a-zA-Z0-9_]{1,20})(?=(.|$))", " LINK");        
        
        List<String> urls;
        Extractor extractor = new Extractor();
        urls = extractor.extractURLs(internalText);
        for(String url : urls){
            internalText = internalText.replaceAll(url, "URLLINK");
            
        }
        
        return internalText;
        

    }

}
